<template>
    <div class="base-info" v-if="Object.keys(goods).length!==0">
        <div class="info-title">{{goods.title}}</div>
        <div class="price">
            <span class="info-price">￥{{goods.realPrice}}</span>
            <span class="old-price">{{goods.oldPrice}}</span>
            <span>{{goods.discount}}</span>
        </div>
        <div class="other">
            <span>{{goods.columns[0]}}</span>
            <span>{{goods.columns[1]}}</span>
            <span>{{goods.services[goods.services.length-1].name}}</span>
        </div>
        <div class="service">
            <span class="service-info" v-for="index in goods.services.length-1" :key="index"> 
                <img :src="goods.services[index-1].icon " alt="">
                <span>{{goods.services[index-1].name}}</span>
            </span>
        </div>
    </div>
</template>

<script>
export default {
    data () {
        return {
            
        }
    },
    props:{
        goods:{
            type:Object
        }
    }
};
</script>

<style lang="less" scoped>
.base-info{
    padding-left: 5px;
    .info-title{
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .price{
        color: gray;
        padding-bottom: 20px;
        .info-price{
            color: red;
            font-size: 25px;
        }
        .old-price{
            margin-left: 10px;
            font-size: 10px;
            text-decoration: line-through;
        }

    }
    .other{
        color: gray;
        font-size: 14px;
        display: flex;
        margin: 10px 0 10px 0;
        padding-bottom: 20px;
        border-bottom: 1px solid #cccccc;
        span{
            flex: 1;
        }
    }
    .service{
        color: #333;
        display: flex;
        flex-wrap: nowrap;
        font-size: 13px;
        padding-top: 20px;
        padding-bottom: 20px;
        border-bottom: 2px solid #cccccc;
        img{
            width: 14px;
            height: 14px;
            position: relative;
            top: 2px;
            
        }
        span{
            flex: 1;
        }
    }
}

</style>

